<%@ page import="com.ContasCorrente"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="layout" content="main" />
<g:set var="entityName"
	value="${message(code: 'contasCorrente.label', default: 'ContasCorrente')}" />
<title><g:message code="default.create.label"
		args="[entityName]" /></title>
</head>
<body>
	<div class="nav">
		<span class="menuButton"><a class="home"
			href="${createLink(uri: '/')}"><g:message
					code="default.home.label" /> </a> </span>
	</div>
	<h1 id="pageName">Concilia&ccedil;&atilde;o Bancaria</h1>

	<g:if test="${flash.message}">
		<div class="message">
			${flash.message}
		</div>
	</g:if>
	<g:hasErrors bean="${contasCorrenteInstance}">
		<div class="errors">
			<g:renderErrors bean="${contasCorrenteInstance}" as="list" />
		</div>
	</g:hasErrors>
	<g:form>
	<table class="IadTableShow">
		<tbody>
			<tr>
				<td class="name">Conta</td>
				<td class="value">				
					${contasCorrenteInstance}
				</td>

				<td class="name">Saldo:</td>
				<td class="value">
					${saldo}
				</td>
			</tr>
	</tbody>
	</table>
		<table class="IadTableList">
			<thead>
				<tr>
					<th>ID</th>
					<th>Descricao</th>
					<th>Data Vencimento</th>
					<th>Valor</th>
					<th>Tipo</th>
					<th>Saldo</th>
					<th>Acrescimo</th>
					<th>Baixar</th>
				</tr>
			</thead>
			<tbody>

				<g:each var="contasList" in="${contasList}">
					<g:if test="${contasList.dataVencimento <= new Date()}">
						<tr class="prop"
							style="background: none repeat scroll 0 0 #FF8585">
					</g:if>
					<g:else>
						<tr class="prop" style="background: #fff">
					</g:else>
					<td class="value">
						${contasList.contaId}
					</td>
					<td class="value">
						${contasList.descricao}
					</td>
					<td class="value">
						${contasList.dataVencimento}
					</td>
					<td class="value">R$ ${contasList.valor}</td>
					<td class="value">
						${contasList.tipo}
					</td>
					<td class="value">${contasList.saldoPendente}</td>
					<!--<td><g:textArea name="acrescimo" cols="20" rows="1"/></td>
					<td class="value"> <input type="text" name="acrescimo" id="acrescimo" > </td>-->
					
					<td>
					 <g:set var="acrescimo" value= "0"></g:set>
					<g:textField name="acrescimo" value="0" />
					</td>
					<td><g:link action="baixaContas" params="[contaId: contasList.contaId, contaCorrente: contasCorrenteInstance.id, contaTipo:contasList.tipo]">
    					BAIXAR
					</g:link></td>
					</tr>
				</g:each>
			</tbody>
		</table>
	</g:form>
</body>
</html>
